﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentValidation;
using Home.Utilities.Validation.ExtensionMethods;
namespace Home.Domain.Entities.Secondary.Validation
{
    public class TPCUserInfoValidator<TTPCUserInfo> : AbstractValidator<TTPCUserInfo> where TTPCUserInfo : TPCUserInfo 
    {
        public TPCUserInfoValidator()
        {
            RuleFor(u => u.UserName)
              .NotEmpty().WithLocalizedName(() => "用户名").UserName();
            RuleFor(u => u.Email).EmailAddress().NotEmpty().WithLocalizedName(() => "邮箱");
            RuleFor(u => u.PassWord).NotEmpty().WithLocalizedName(() => "密码");
        }
    }
}
